package com.hu.video.controller;

import com.hu.video.entity.VideoBlacklist;
import com.hu.video.service.IVideoBlacklistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@RestController
@RequestMapping("/api/video/blacklist")
public class VideoBlacklistController {
    @Autowired
    private IVideoBlacklistService service;

    @GetMapping("/{videoId}")
    public List<VideoBlacklist> getBlacklist(@PathVariable Long videoId) {
        return service.getByVideoId(videoId);
    }

    @PostMapping("/add")
    public String addBlacklist(@RequestBody VideoBlacklist blacklist) {
        service.addBlacklist(blacklist);
        return "success";
    }

    @PostMapping("/remove")
    public String removeBlacklist(@RequestBody VideoBlacklist blacklist) {
        service.removeBlacklist(blacklist);
        return "success";
    }
} 